<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<link href="http://127.0.0.1/vancl/Static/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
		<!-- Loading Flat UI -->
		<link href="http://127.0.0.1/vancl/Static/Flat/dist/css/flat-ui.css" rel="stylesheet">		
		<link href="http://127.0.0.1/vancl/Static/Admin/css/style.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			.imgtable td {
				text-indent: 0px;
				text-align: center;
				padding: 10px;
			}
			.t_address{
				width: 260px;
			}
		</style>	
		<script type="text/javascript" src="http://127.0.0.1/vancl/Static/Admin/js/jquery.js"></script>
		<script language="javascript">
			$(function() {
				//导航切换
				$(".imglist li").click(function() {
					$(".imglist li.selected").removeClass("selected")
					$(this).addClass("selected");
				})
			})
		</script>
		
	</head>

	<body>

		<div class="place">
			<span>位置：</span>
			<ul class="placeul">
				<li><a href="#">订单管理</a></li>
				<li><a href="#">订单管理</a></li>
				<li><a href="#">订单列表</a></li>
			</ul>
		</div>

		<div class="rightinfo">

			<table class="imgtable">

				<thead>
					<tr>
						<th>ID</th>
						<th>订单号</th>
						<th>收货人</th>
						<th class="t_address">收货地址</th>
						<th>联系电话</th>
						<th>合计金额</th>
						<th>下单时间</th>
						<th>状态</th>
						<th>用户</th>
						<th>操作</th>
					</tr>
				</thead>

				<tbody>
					    <?php if(count($data)==0){ ?>
						<tr>
							<td colspan="10" align="center">
								还没有任何订单
							</td>
						</tr>
					<?php }else{ ?>
						<?php foreach ($data as $k=>$v){?>
							<tr>
								<td><?php echo $v['oid'];?></td>
								<td><?php echo $v['orderNo'];?></td>
								<td><?php echo $v['recipient'];?></td>
								<td class="t_address"><?php echo $v['address'];?></td>
								<td><?php echo $v['phoneNo'];?></td>
								<td><?php echo $v['total'];?></td>
								<td><?php echo date("Y-m-d h:i:s",$v['time']);?></td>
								<td><?php echo $v['status'];?></td>
								<td><?php echo $v['username'];?></td>
								<td style="text-align: left;">
									<a href="<?php echo U('OrderList/Index',array('oid'=>$v['oid']));?>" class="tablelink">订单列表</a>
<!--									<a href="<?php echo U('Edit',array('oid'=>$v['oid']));?>" class="tablelink">修改</a>-->
									    <?php if($v['status']=='待发货'){ ?>
										<a href="<?php echo U('Cancel',array('oid'=>$v['oid']));?>" class="tablelink" onclick="if (!confirm('确认要取消吗？')) return false;" style="color:red">取消</a>
										<a href="<?php echo U('Finish',array('oid'=>$v['oid']));?>" class="tablelink" onclick="if (!confirm('确认已完成吗？')) return false;" style="color:darkgreen;">完成</a>
									<?php } ?>
									    <?php if($v['status']=='已完成' || $v['status']=='已取消'){ ?>
										<a href="<?php echo U('Del',array('oid'=>$v['oid']));?>" class="tablelink" onclick="if (!confirm('确认要删除吗？')) return false;" style="color:red">删除</a>
									<?php } ?>
								</td>
							</tr>
						<?php }?>
					<?php } ?>
				</tbody>
			</table>	
		</div>

		<script type="text/javascript">
			$('.imgtable tbody tr:odd').addClass('odd');
		</script>

	</body>

</html>